import { register } from "~/apis/user";
import { toast } from "~/utils/wxapi";
Page({
  /**
   * 页面的初始数据
   */
  data: {
    name: "",
    mobile: "",
    password: "",
  },
  async sub() {
    const { name, mobile, password } = this.data;
    const res = await register({ name, mobile, password });
    console.log(res);
    if (res.code === 200) {
      toast(res.message)
      setTimeout(() => {
        wx.switchTab({ url: '/pages/my/my' })
      }, 1000)
    }
  },
});
